package com.culturalCenter.dataCenter.mapper.user;

import com.culturalCenter.dataCenter.entity.user.Picture;
import com.culturalCenter.dataCenter.mapper.base.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface PictureMapper extends BaseMapper<Picture> {

    /**
     * 通过用户id查询
     *
     * @param userId 用户id
     *
     * @return
     */
    List<Picture> queryByUserId(@Param("userId") String userId);

    @Select("SELECT picture FROM cdc_picture p INNER JOIN cdc_user_location_picture ulp ON p.id = ulp.pictureId AND ulp.locationId = #{locationId} ")
    List<String> queryURLByUserId(@Param("locationId") String locationId);

}
